package com.wangtianxiang.sxp.back.module.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wangtianxiang.sxp.back.po.SysUser;
import com.wangtianxiang.sxp.back.module.dao.SysUserMapper;
import com.wangtianxiang.sxp.back.module.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wangtianxiang.sxp.common.utils.MD5Utils;

/**
 * @author wangtianxiang
 * @description
 * @date 2021/4/18
 */
@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements SysUserService {


    @Autowired
    private SysUserMapper sysUserMapper;

    @Override
    public int saveUser(SysUser sysUser) {
        //md5加密
        sysUser.setPassword(MD5Utils.getSaltMd5AndSha(sysUser.getPassword()));
//        sysUser.setCreateTime(new Date());
        return sysUserMapper.insert(sysUser);
    }
}
